package com.cwx.service.impl;

import com.cwx.dao.UserDao;
import com.cwx.domain.User;
import com.cwx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> findAll() {
      List<User> userList = userDao.findAll();
	return userList;
    }
    //删除用户信息
    @Override
    public void deleteOneUser(Integer id) {
        userDao.delete(id);
        
    }

    /**
     * 根据id查询用户
     * @param id
     * @return
     */
    @Override
    public User findById(Integer id) {
        User user = userDao.findById(id);
        return user;
    }
}
